package com.ecoolex.ying.space.ws;

import com.ecoolex.framework.common.exception.BizException;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.framework.common.pojo.Sorting;
import com.ecoolex.ying.space.core.manager.FeedbackManager;
import com.ecoolex.ying.space.entity.Feedback;
import com.ecoolex.ying.space.pojo.AddFeedbackDTO;
import com.ecoolex.ying.space.pojo.EditFeedbackDTO;
import com.ecoolex.ying.space.pojo.QueryFeedbackDTO;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class FeedbackServiceImpl implements FeedbackService {

    @Autowired
    private FeedbackManager feedbackManager;

    @Override
    public Feedback getFeedbackById(Integer id) {
        return feedbackManager.getById(id);
    }

    @Override
    public Pagination<Feedback> queryFeedback(QueryFeedbackDTO query, Sorting[] sorts, Page page) {
        return feedbackManager.query(query, sorts, page);
    }

    @Override
    public Feedback addFeedback(AddFeedbackDTO record, String createUser) throws BizException {
        return feedbackManager.add(record, createUser);
    }

    @Override
    public Feedback updateFeedback(EditFeedbackDTO record, String updateUser) throws BizException {
        return feedbackManager.update(record, updateUser);
    }

}
